import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { IEchartIlineData, ITopCard } from "./types";

/* TopCard数据 */
export function getTopBookingDataAPI(): AxiosPromise<ITopCard> {
  return request({
    url: `/dataStatistical/top/booking/data`,
    method: "get",
  });
}

/* 获取最近7/14天预约情况 */
export function getRecentBookingDataAPI(
  days: number
): AxiosPromise<IEchartIlineData> {
  return request({
    url: `/dataStatistical/recent/booking/${days}`,
    method: "get",
  });
}

export function getRecentResourceAPI(
  days: number
): AxiosPromise<IEchartIlineData> {
  return request({
    url: `/dataStatistical/recent/resource`,
    method: "get",
  });
}

export function getResourceUseAPI(): AxiosPromise<IEchartIlineData> {
  return request({
    url: `/dataStatistical/recent/resource/use`,
    method: "get",
  });
}
